package cn.edu.sgu.www.mhxysy.service.potency.impl;

import cn.edu.sgu.www.mhxysy.entity.potency.PotencyFruitSchema;
import cn.edu.sgu.www.mhxysy.mapper.potency.PotencyFruitSchemaMapper;
import cn.edu.sgu.www.mhxysy.service.potency.PotencyFruitSchemaService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 沐雨橙风ιε
 * @version 1.0
 */
@Service
public class PotencyFruitSchemaServiceImpl implements PotencyFruitSchemaService {

    private final PotencyFruitSchemaMapper potencyFruitSchemaMapper;

    @Autowired
    public PotencyFruitSchemaServiceImpl(PotencyFruitSchemaMapper potencyFruitSchemaMapper) {
        this.potencyFruitSchemaMapper = potencyFruitSchemaMapper;
    }

    @Override
    public PotencyFruitSchema selectById(Integer id) {
        return potencyFruitSchemaMapper.selectById(id);
    }

    @Override
    public List<PotencyFruitSchema> selectByRoleId(String roleId) {
        QueryWrapper<PotencyFruitSchema> queryWrapper = new QueryWrapper<>();

        queryWrapper.eq("role_id", roleId);

        return potencyFruitSchemaMapper.selectList(queryWrapper);
    }

}